<template>
  <div>
    <van-nav-bar title="收藏列表" left-arrow @click-left="$router.back()" />
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="onLoad"
    >
      <CollectItem
        v-for="item in list"
        :key="item.houseCode"
        :item="item"
      ></CollectItem>
    </van-list>
  </div>
</template>

<script>
import { getCollect } from '@/api/user'
import CollectItem from '@/components/CollectItem.vue'
export default {
  components: {
    CollectItem
  },
  nam: 'collect-page',
  data () {
    return {
      list: [],
      loading: false,
      finished: false
    }
  },
  methods: {
    async onLoad () {
      const { data: { body } } = await getCollect()
      console.log(body)
      this.list.push(...body)
    }
  }
}
</script>

<style></style>
